/*我的收藏*/
Ext.define('qjtravel.view.Call', {
    extend: 'Ext.Container',
    xtype: 'call',
    requires:[
        'Ext.data.Store',
        "Ext.dataview.List"
    ],

    number:'',
    config:{
        layout:'card',
        items:
            [
                {
                    xtype:'titlebar',
                    docked:'top',
                    title:'',
                    items:{
                        xtype:'button',
                        text:'返回',
                        handler:function(){
                            Ext.Viewport.remove(this.up('call'),true);
                        }
                    }
                },
                {
                    xtype:'list',
                    selectedCls:false,
                    scrollable: true,
                    store:'Call',
                    itemTpl:
                        "<div class='oneCall'>"+
                            "<img src='resources/images/tel.png' style=' float:left; width:40px; height:44px; margin-right: 16px'/>"+
                            "<div class='font1 color2'>{name}</div>"+
                            "<div class='font1 color1' id='number'>{number}</div>"+
                        "</div>",
                    listeners: {
                        initialize: function () {
                            var Call = Ext.getStore('Call');
                            Call.load({
                                params:{cadid:localStorage.getItem('cadid')}
                            })
                        },

                        painted: function (label) {
                            label.on('tap', function () {
                                var args = document.getElementById('number').innerHTML
                                cordova.exec(function (successCallback) {
                                }, function (errorCallback) {
                                }, "Redirect", "callNumber", [args]);
                                return false;
                            }, this)
                        }
                    }
                }
            ],listeners: {
            back:function() {
                Ext.Viewport.remove(Ext.Viewport.getActiveItem(), true);
            }
        }
    }
});

